package com.zbs.framework.common.redis;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @description:redis配置类
 * @author: Zbs
 * @create: 2020-05-28 19:24
 */
@Configuration
@Conditional(RedisCondition.class)
@ConfigurationProperties(prefix = "spring.redis")
public class RedisConfig extends CachingConfigurerSupport {

    /**
     * redis数据库
     */
    public static Integer database;

    /**
     * host
     */
    public static String host;

    /**
     * 端口
     */
    public static Integer port;

    /**
     * password
     */
    public static String password;


    /*注入配置*/


    public void setDatabase(Integer database){
        RedisConfig.database = database;
    }

    public void setHost(String host){
        RedisConfig.host = host;
    }

    public void setPort(Integer port){
        RedisConfig.port = port;
    }

    public void setPassword(String password){
        RedisConfig.password = password;
    }


}
